package com.mall.parking.controller;

import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
@Api("测试类")
public class APITestController {

    @ApiOperation("问候")
    @PostMapping("/hello")
    @ApiImplicitParam(required = true, name = "name", dataType = "String", value = "名字", defaultValue = "world", paramType = "query")
    public Hello hello(String name) {
        Hello hello = new Hello();
        hello.setName(name);
        return hello;
    }

}

@ApiModel
class Hello {

    @ApiModelProperty("姓名")
    private String name;

    @ApiModelProperty("年龄")
    private int age = 10;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

